package com.hl.shifangzhiyu.web;

import com.hl.shifangzhiyu.pojo.Wenti;
import com.hl.shifangzhiyu.service.WentiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/wenti")
public class WentiController {

@Autowired
    private WentiService wentiService;
    @RequestMapping("/insert")
    public int insert(@RequestBody Wenti wenti) {
        return wentiService.Insert(wenti);
    }

    @RequestMapping("/select")
    public List<Wenti> select(@RequestParam(required = false) int zId) {
        return wentiService.SelectAll(zId);
    }
}
